{{extend './_layouts/home.html'}}

{{block 'title'}}{{'多人博客 - 首页'}}{{/block}}

{{block 'body'}}
<section class="container">
  <ul class="media-list">
   {{each blogs}}
    <li class="media">
      <div class="media-left">
        <a href="#">
            <img width="40" height="40" class="media-object" src="../public/img/avatar-default.png" alt="...">
          </a>
      </div>
      <div class="media-body">
        <h4 class="media-heading"><a href="/show?id={{$value.id}}">{{$value.title}}</a></h4>
        <h6>{{$value.model}}</h6>
        <p>sueysok 回复了问题 • 2 人关注 • 1 个回复 • 187 次浏览 •{{$value.created_time}}</p>
      </div>
    </li>
  {{/each}}
  </ul>

  <nav aria-label="Page navigation">
    <ul class="pagination">
      <li>
        <a href="#" aria-label="Previous">
        <span aria-hidden="true">&laquo;</span>
      </a>
      </li>
      <li class="active"><a href="#">1</a></li>
      <li><a href="#">2</a></li>
      <li><a href="#">3</a></li>
      <li><a href="#">4</a></li>
      <li><a href="#">5</a></li>
      <li>
        <a href="#" aria-label="Next">
        <span aria-hidden="true">&raquo;</span>
      </a>
      </li>
    </ul>
  </nav>
</section>
{{/block}}
<!--{{block 'script'}}-->
<!--<script>-->

<!--    var formData = $(this).serialize()-->
<!--    $.ajax({-->
<!--      url: '/',-->
<!--      type: 'get',-->
<!--      data: formData,-->
<!--      dataType: 'json',-->
<!--      success: function (data) {-->
<!--        console.log('111',data);-->
<!--        var Blogs = data.blogs-->
<!--        var err_code = data.err_code-->
<!--        if (err_code === 0) {-->
<!--          window.alert('提交成功！')-->
<!--// 服务端重定向针对异步请求无效-->
<!--          window.location.href = '/'-->
<!--        } else if (err_code === 1) {-->
<!--          window.alert('提交失败！')-->
<!--        }-->
<!--      }-->
<!--    })-->

<!--</script>-->

<!--{{/block}}-->

